{% extends "admin/base.html" %}
{% block mainbody %}                
    <h3>
        会员信息管理
    </h3>
    <form id="edit-profile" onsubmit="return checkinput();" action="{% url 'myadmin_users_pwdSave' user.id %}" class="form-horizontal" method="post">
        {% csrf_token %}
        <fieldset>
            <legend>重置会员密码信息</legend>
            <div class="control-group">
                <label class="control-label" for="input01">账号：</label>
                <div class="controls">
                    {{ user.username }}
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input02">真实姓名：</label>
                <div class="controls">
                    <input type="text" name="name" disbled class="input-xlarge" id="input02" value="{{ user.name }}" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="pwd1">密码：</label>
                <div class="controls">
                    <input type="password" name="password" class="input-xlarge" id="pwd1"/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="pwd2">重复密码：</label>
                <div class="controls">
                    <input type="password" name="repassword" class="input-xlarge" id="pwd2"/>
                </div>
            </div>                      
            <div class="form-actions">
                <button type="submit" class="btn btn-primary">保存</button>
                <button type="reset" class="btn">重置</button>
            </div>
        </fieldset>
    </form>
    <script type="text/javascript">
        function checkinput () {
            var errmsg="";
            //密码是否一致
            var pwd1=$("#pwd1").val();
            var pwd2=$("#pwd2").val();
            if(pwd1==""){
                errmsg="请输入密码!";
            }else if(pwd1!=pwd2){
                errmsg="两次输入密码不一致！";
            }
            if(errmsg!=""){
                alert(errmsg)
                return false;
            }
        }
    </script>
{% endblock %}